﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SqlSugar;
using Zocono.WCS.Infrastructure.ApllicationDto.Enums;

namespace Zocono.WCS.Domain.EntityInfo
{
    [SugarTable("WorkTaskInfo")]
    public class WorkTaskInfo : IEntity
    {
        /// <summary>
        /// /巷道分组表ID
        /// </summary>
        [SugarColumn(IsPrimaryKey = true)]
        public long ID { get; set; }

        /// <summary>
        /// 路径ID
        /// </summary>
        public long RouteID { get; set; }

        /// <summary>
        /// 优先级
        /// </summary>
        public int Priority { get; set; }

        /// <summary>
        /// 托盘编号
        /// </summary>
        public string PalletCode { get; set; }
        /// <summary>
        ///WCS任务编号 取wms taskcode 的 日 + 流水号
        /// </summary>
        public int TaskCode { get; set; }
        /// <summary>
        ///任务执行状态 取值枚举EnumTaskProcessState
        /// </summary>
        public EnumTaskProcessState TaskProcessState { get; set; }
        /// <summary>
        /// 任务状态取值枚举EnumTaskState
        /// </summary>
        public EnumTaskState TaskState { get; set; }
        /// <summary>
        /// 任务类型
        /// 取值枚举EnumTaskType 
        /// [Description("工位到巷道上架")] STA=1
        /// [Description("巷道到工位下架")]ATS = 2,
        /// [Description("同巷道间移库")]AA = 3, 
        /// [Description("不同巷道间倒库")]ATA = 4,
        /// [Description("工位间越库")]STS = 5,
        /// </summary>
        public EnumTaskType TaskType { get; set; }
        /// <summary>
        /// 添加时间
        /// </summary>
        public DateTime SaveTime { get; set; }
        /// <summary>
        /// 修改时间
        /// </summary>
        public DateTime UpdateTime { get; set; }
        /// <summary>
        /// WMS任务编号
        /// </summary>
        public long WmsTaskCode { get; set; }
        /// <summary>
        /// 依赖WMS任务编号
        /// </summary>
        public long DependWmsTaskCode { get; set; }
        /// <summary>
        /// 起始工位
        /// </summary>
        public string WmsFromStation { get; set; }
        /// <summary>
        /// 起始位置
        /// </summary>
        public string WmsFromPosition { get; set; }
        /// <summary>
        /// 目标工位
        /// </summary>
        public string WmsToStation { get; set; }
        /// <summary>
        /// 目标位置
        /// </summary>
        public string WmsToPosition { get; set; }
        /// <summary>
        /// 子任务路径明细ID
        /// </summary>
        public long CurrentRounteDetailID { get; set; }
        /// <summary>
        /// 子任务状态 取值枚举EnumDetailTaskState
        /// </summary>
        public EnumDetailTaskState CurrentDetailTaskState { get; set; }
        /// <summary>
        /// 子任务调度类型 取值枚举EnumDispatchType Planar=1  SC_UP=2 SC_DOWN=3   SC_MOVE=4  RGV=5 AGV=6  Lifter=7 Robot=8  SC_Cross=9
        /// </summary>
        public EnumDispatchType CurrentDispatchType { get; set; }
        /// <summary>
        /// 子任务起始位置
        /// </summary>
        public string CurrentFromEquipment { get; set; }
        /// <summary>
        /// 子任务起始货位
        /// </summary>
        public string CurrentFromCargo { get; set; }
        /// <summary>
        /// 子任务目标位置
        /// </summary>
        public string CurrentToEquipment { get; set; }
        /// <summary>
        /// 子任务目标货位
        /// </summary>
        public string CurrentToCargo { get; set; }
        /// <summary>
        /// 子任务创建时间
        /// </summary>
        public DateTime CurrentCreateTime { get; set; }
        /// <summary>
        /// 子任务更新时间
        /// </summary>
        public DateTime CurrentUpdateTime { get; set; }

        /// <summary>
        /// 上传WMS状态：0-未上传；1-成功；2-失败
        /// 取值枚举EnumUploadWmsState
        /// </summary>
        public EnumUploadWmsState UploadWmsState { get; set; } = 0;
        /// <summary>
        /// 上传WMS时间
        /// </summary>
        public DateTime UploadWmsTime { get; set; } = new DateTime(1900, 1, 1);
    }
}
